package com.danbay.cloud.base.constants;


/**
 * 电表报警信息
 * @author SJG
 * 2017/11/22
 */
public enum EmWarning {
    VOLTAGE_EXCEPTION(0x001,"电压瞬间异常波动报警"),
    CURRENT_EXCEPTION(0x002,"电流瞬间异常波动报警"),
    FAULT(0x003,"电表设备故障报警");

    private final int value;
    private final String phrase;

    EmWarning(int value , String phrase){
        this.value = value;
        this.phrase = phrase;
    }

    public int value(){
        return value;
    }

    public static String getPhrase(int value){
        for(EmWarning t : values()){
            if(t.value == value){
                return t.phrase;
            }
        }
        return "错误状态";
    }
}